<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?><!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/public/js/html5shiv.js"></script>
    <script type="text/javascript" src="/public/js/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/Hui-iconfont/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/style.css" />
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="/public/js/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>快方管理后台</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <style type="text/css">
        .driver_name {
            color: #009cf9;
        }
        .driver_name:hover{  
            cursor:pointer;  
        }   
        .layui-layer-content pre{
            padding: 20px;
            margin-bottom: 0px;
        }
    </style>
</head>
<body class="big-page">
<form id="form1">
<table class="table table-border">
    <tr>
        <td>订单号：</td>
        <td colspan="3"><?=$data['DH'] ?></td>
    </tr>
    <tr>
        <td>配送平台：</td>
        <td><?=$pt_name ?></td>
        <td>配送状态：</td>
        <td><?=$order_status ?></td>
    </tr>
    <tr>
        <td>距离(m)：</td>
        <td><?=$data['PSJL'] ?></td>
        <td>价格(￥)：</td>
        <td><?=$data['PSJG'] ?></td>
    </tr>
    <tr>
        <td>骑手姓名：</td>
        <td class='driver_name' data-driver_name='<?=$courierInfo['dirver_name'] ?>' data-store_id='<?=$data['YID'] ?>'><?=$courierInfo['dirver_name'] ?></td>
        <td>骑手电话：</td>
        <td><?=$courierInfo['dirver_phone'] ?></td>
    </tr>
    <input type="hidden" name="search_date" value="<?=date('Y-m-d',$data['createtime']) ?>">
</table>
<table class="table table-border" style="border-top:none; ">
    <tr>
        <td colspan="4" style="font-size: 16px;"><h3>订单日志</h3></td>
    </tr>
    <tr>
        <th>配送状态</th>
        <th>配送时间</th>
        <th>时间间隔</th>
        <th>总耗时</th>
    </tr>
    <?php foreach ($log as $key => $val) { ?>
        <tr>
            <td class="show-bz" data-val='<?=$val['BZ'] ?>'><?=$val['ZT'] ?></td>
            <td><?=$val['time'] ?></td>
            <td><?=$val['dif_time'] ?></td>
            <td><?=$val['all_time'] ?></td>
        </tr>
    <?php } ?>
</table>
</form>

<script type="text/javascript" src="/public/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/plugins/layer/layer.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/public/plugins/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript">
    $(document).on("click", ".driver_name", function(){
        var driver_name = $(this).data("driver_name");
        var search_date = $("input[name=search_date]").val();
        var store_id = $(this).data("store_id");

        if(driver_name == '-')
        {
            return false;
        }
        
        window.location.href = '/ThirdOrder/getDeliveryDriverOrder?driver_name=' + driver_name + '&search_date=' + search_date + '&store_id=' +  store_id;
        
    })

    $(document).on("dblclick", ".show-bz", function(){
        var str1 = $(this).data('val');
        var title = $(this).text();


        if(typeof(str1) == "object"){
            var str = JSON.stringify(str1, null, 4);
            str = unescape(str.replace(/(u[0-9a-fA-F]{4})/gm, '%$1'));
            layer.open({
              type: 1,
              skin: 'layui-layer-demo', //样式类名
              closeBtn: 0, //不显示关闭按钮
              anim: 2,
              title: title,
              shadeClose: true, //开启遮罩关闭
              content: "<pre>" + str + "</pre>"
            });
        }
        
    })
    
</script>
</body>
</html>
